import { requestWithToken } from "../utils/request";

// 获取商品详情
export function getGoodsOne(id) {
  return requestWithToken("/goods", "get", { id });
}

// 获取 同类推荐/猜你喜欢
export function getRelevantData(id, limit = 12) {
  return requestWithToken("/goods/relevant", "get", { id, limit });
}

// 获取热销推荐
export function getHotData(id, type) {
  return requestWithToken("/goods/hot", "get", { id, limit: 4, type });
}

// 获取评论数据
export function getCommentData(id) {
  return requestWithToken(
    `https://mock.boxuegu.com/mock/1175/goods/${id}/evaluate`,
    "get"
  );
}

// 获取评论列表数据
export function getCommentListApi(id, params) {
  return requestWithToken(
    `https://mock.boxuegu.com/mock/1175/goods/${id}/evaluate/page`,
    "get",
    params
  );
}
